home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / share / hplip / base / codes.py < prev    next >
Text File  |  2008-10-13  |  24KB  |  722 lines

  1. # -*- coding: utf-8 -*-
  2. #
  3. # (c) Copyright 2003-2008 Hewlett-Packard Development Company, L.P.
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  18. #
  19. # Author: Don Welch
  20. #
  21. #
  22. # NOTE: This module is safe for 'from codes import *'
  23. #
  24.  
  25.  
  26. # GUI/Console modes
  27. INTERACTIVE_MODE = 0 # -i
  28. GUI_MODE = 1 # -u
  29. NON_INTERACTIVE_MODE = 2 # -n
  30. BROWSER_MODE = 3 # -w
  31.  
  32. # device types (CUPS queue or SANE types)
  33. DEVICE_TYPE_UNKNOWN = 0
  34. DEVICE_TYPE_PRINTER = 1 # hp:
  35. DEVICE_TYPE_SCANNER = 2 # hpaio:
  36. DEVICE_TYPE_FAX = 3     # hpfax:
  37. DEVICE_TYPE_COPIER = 4  # not used
  38.  
  39. # Error Codes generated by HPMUD or raise Error(code) or func return
  40. # Add 5000 to code for event code
  41. ERROR_SUCCESS = 0
  42. ERROR_UNKNOWN_ERROR = 1
  43. ERROR_DEVICE_NOT_FOUND = 2 # MUD: HPMUD_R_INVALID_DEVICE
  44. ERROR_INVALID_DEVICE_ID = 3 # MUD: HPMUD_R_INVALID_DESCRIPTOR
  45. ERROR_INVALID_DEVICE_URI = 4 # MUD: HPMUD_R_INVALID_URI
  46. ERROR_DATA_LENGTH_EXCEEDS_MAX = 8 # MUD: HPMUD_R_INVALID_LENGTH
  47. ERROR_DEVICE_IO_ERROR = 12 # MUD: HPMUD_R_IO_ERROR
  48. ERROR_NO_PROBED_DEVICES_FOUND = 18
  49. ERROR_DEVICE_BUSY = 21 # MUD: HPMUD_R_DEVICE_BUSY
  50. ERROR_DEVICE_STATUS_NOT_AVAILABLE = 26
  51. ERROR_INVALID_SERVICE_NAME = 28 # MUD: HPMUD_R_INVALID_SN
  52. ERROR_ERROR_INVALID_CHANNEL_ID = 30 # MUD: HPMUD_R_INVALID_CHANNEL_ID
  53. ERROR_CHANNEL_BUSY = 31 # MUD: HPMUD_R_INVALID_STATE
  54. ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION = 34 
  55. ERROR_DEVICEOPEN_FAILED = 37 # MUD: HPMUD_R_INVALID_DEVICE_OPEN
  56. ERROR_INVALID_DEVNODE = 38 # MUD: HPMUD_R_INVALID_DEVICE_NODE
  57. ERROR_INVALID_HOSTNAME = 45 # MUD: HPMUD_R_INVALID_IP
  58. ERROR_INVALID_PORT_NUMBER = 46 # MUD: HPMUD_R_INVALID_IP_PORT
  59. ERROR_INVALID_TIMEOUT = 47 # MUD: HPMUD_R_INVALID_TIMEOUT
  60. ERROR_DATFILE_ERROR = 48 # MUD: HPMUD_R_DATFILE_ERROR
  61. ERROR_IO_TIMEOUT = 49 # MUD: HPMUD_R_IO_TIMEOUT 
  62. ERROR_FAX_INCOMPATIBLE_OPTIONS = 50
  63. ERROR_FAX_INVALID_FAX_FILE = 51
  64. ERROR_NO_CUPS_QUEUE_FOUND_FOR_DEVICE = 55
  65. ERROR_FAX_FILE_NOT_FOUND = 57
  66. # --> add new codes here <--
  67. ERROR_INTERNAL = 99
  68. # If you add new codes, also add the appropriate description
  69. # to g.py for exception description strings.
  70. # Thank you, The Management
  71.  
  72.  
  73. # Event and status codes
  74. # These are used for the 'status-code' returned by DeviceQuery (STATUS_*)
  75. # and by the event-code used by Event (EVENT_* + STATUS_*)
  76.  
  77. # If you add a new EVENT/STATUS code, please add the appropriate
  78. # entry into the STATUS_TO_ERROR_STATE_MAP
  79.  
  80. STATUS_UNKNOWN = 0
  81.  
  82. EVENT_MIN_USER_EVENT = 500
  83. EVENT_START_PRINT_JOB = 500 # sent by hp: backend
  84. EVENT_END_PRINT_JOB = 501 # sent by hp: backend
  85.  
  86. EVENT_START_FAX_PRINT_JOB = 600 # sent by hpfax: backend
  87. EVENT_END_FAX_PRINT_JOB = 601 # sent by hpfax: backend
  88.  
  89. EVENT_PRINTER_QUEUE_STOPPED = 700
  90. EVENT_PRINTER_QUEUE_STARTED = 701
  91. EVENT_PRINTER_QUEUE_REJECTING_JOBS = 702
  92. EVENT_PRINTER_QUEUE_ACCEPTING_JOBS = 703
  93. EVENT_PRINTER_QUEUE_SET_AS_DEFAULT = 704
  94.  
  95. EVENT_FAX_QUEUE_STOPPED = 800
  96. EVENT_FAX_QUEUE_STARTED = 801
  97. EVENT_FAX_QUEUE_REJECTING_JOBS = 802
  98. EVENT_FAX_QUEUE_ACCEPTING_JOBS = 803
  99. EVENT_FAX_QUEUE_SET_AS_DEFAULT = 804
  100.  
  101. STATUS_PRINTER_BASE = 1000
  102. STATUS_PRINTER_IDLE = 1000
  103. STATUS_PRINTER_BUSY = 1001
  104. STATUS_PRINTER_PRINTING = 1002
  105. STATUS_PRINTER_TURNING_OFF = 1003
  106. STATUS_PRINTER_REPORT_PRINTING = 1004
  107. STATUS_PRINTER_CANCELING = 1005
  108. STATUS_PRINTER_IO_STALL = 1006
  109. STATUS_PRINTER_DRY_WAIT_TIME = 1007
  110. STATUS_PRINTER_PEN_CHANGE = 1008
  111. STATUS_PRINTER_OUT_OF_PAPER = 1009
  112. STATUS_PRINTER_BANNER_EJECT = 1010
  113. STATUS_PRINTER_BANNER_MISMATCH = 1011
  114. STATUS_PRINTER_PHOTO_MISMATCH = 1012
  115. STATUS_PRINTER_DUPLEX_MISMATCH = 1013
  116. STATUS_PRINTER_MEDIA_JAM = 1014
  117. STATUS_PRINTER_CARRIAGE_STALL = 1015
  118. STATUS_PRINTER_PAPER_STALL = 1016
  119. STATUS_PRINTER_PEN_FAILURE = 1017
  120. STATUS_PRINTER_HARD_ERROR = 1018
  121. STATUS_PRINTER_POWER_DOWN = 1019
  122. STATUS_PRINTER_FRONT_PANEL_TEST = 1020
  123. STATUS_PRINTER_CLEAN_OUT_TRAY_MISSING = 1021
  124. STATUS_PRINTER_OUTPUT_BIN_FULL = 1022
  125. STATUS_PRINTER_MEDIA_SIZE_MISMATCH = 1023
  126. STATUS_PRINTER_MANUAL_DUPLEX_BLOCK = 1024
  127. STATUS_PRINTER_SERVCE_STALL = 1025
  128. STATUS_PRINTER_OUT_OF_INK = 1026 # Also used for out of toner
  129. STATUS_PRINTER_LIO_ERROR = 1027
  130. STATUS_PRINTER_PUMP_STALL = 1028
  131. STATUS_PRINTER_TRAY_2_MISSING = 1029
  132. STATUS_PRINTER_DUPLEXER_MISSING = 1030
  133. STATUS_PRINTER_REAR_TRAY_MISSING = 1031
  134. STATUS_PRINTER_PEN_NOT_LATCHED = 1032
  135. STATUS_PRINTER_BATTERY_VERY_LOW = 1033
  136. STATUS_PRINTER_SPITTOON_FULL = 1034
  137. STATUS_PRINTER_OUTPUT_TRAY_CLOSED = 1035
  138. STATUS_PRINTER_MANUAL_FEED_BLOCKED = 1036
  139. STATUS_PRINTER_REAR_FEED_BLOCKED = 1037
  140. STATUS_PRINTER_TRAY_2_OUT_OF_PAPER = 1038
  141. STATUS_PRINTER_UNABLE_TO_LOAD_FROM_LOCKED_TRAY = 1039
  142. STATUS_PRINTER_NON_HP_INK = 1040
  143. STATUS_PRINTER_PEN_CALIBRATION_RESUME = 1041
  144. STATUS_PRINTER_MEDIA_TYPE_MISMATCH = 1042
  145. STATUS_PRINTER_CUSTOM_MEDIA_MISMATCH = 1043
  146. STATUS_PRINTER_PEN_CLEANING = 1044
  147. STATUS_PRINTER_PEN_CHECKING = 1045
  148.  
  149. # "synthetic" codes
  150. # set to AGENT_TYPE + base (base: 1500=ink, 1600=laser )
  151. STATUS_PRINTER_LOW_INK_BASE = 1500
  152. STATUS_PRINTER_LOW_BLACK_INK = 1501
  153. STATUS_PRINTER_LOW_TRI_COLOR_INK = 1502
  154. STATUS_PRINTER_LOW_PHOTO_INK = 1503
  155. STATUS_PRINTER_LOW_CYAN_INK = 1504
  156. STATUS_PRINTER_LOW_MAGENTA_INK = 1505
  157. STATUS_PRINTER_LOW_YELLOW_INK = 1506
  158. STATUS_PRINTER_LOW_PHOTO_CYAN_INK = 1507
  159. STATUS_PRINTER_LOW_PHOTO_MAGENTA_INK = 1508
  160. STATUS_PRINTER_LOW_PHOTO_YELLOW_INK = 1509
  161. STATUS_PRINTER_LOW_PHOTO_GRAY_INK = 1510
  162. STATUS_PRINTER_LOW_PHOTO_BLUE_INK = 1511
  163.  
  164. STATUS_PRINTER_LOW_TONER_BASE = 1600
  165. STATUS_PRINTER_LOW_BLACK_TONER = 1601
  166. STATUS_PRINTER_LOW_CYAN_TONER = 1604
  167. STATUS_PRINTER_LOW_MAGENTA_TONER = 1605
  168. STATUS_PRINTER_LOW_YELLOW_TONER = 1606
  169. # end
  170.  
  171. # "synthetic" laserjet codes
  172. STATUS_PRINTER_WARMING_UP = 1800
  173. STATUS_PRINTER_LOW_PAPER = 1801
  174. STATUS_PRINTER_DOOR_OPEN = 1802
  175. STATUS_PRINTER_OFFLINE = 1803
  176. STATUS_PRINTER_LOW_TONER = 1804
  177. STATUS_PRINTER_NO_TONER = 1805
  178. STATUS_PRINTER_SERVICE_REQUEST = 1806
  179. STATUS_PRINTER_FUSER_ERROR = 1807
  180. #end
  181.  
  182. # other "synthetic" codes
  183. STATUS_DEVICE_UNSUPPORTED = 1900
  184. #end
  185.  
  186. # scan
  187. EVENT_START_SCAN_JOB = 2000
  188. EVENT_END_SCAN_JOB = 2001
  189. EVENT_SCANNER_FAIL = 2002
  190. #end
  191.  
  192. # fax
  193. EVENT_START_FAX_JOB = 3000
  194. EVENT_END_FAX_JOB = 3001
  195. EVENT_FAX_JOB_FAIL = 3002
  196. EVENT_FAX_JOB_CANCELED = 3003
  197. STATUS_FAX_TX_ACTIVE = 3004
  198. STATUS_FAX_RX_ACTIVE = 3005
  199. #end
  200.  
  201. # copy
  202. EVENT_START_COPY_JOB = 4000
  203. EVENT_END_COPY_JOB = 4001
  204. EVENT_COPY_JOB_FAIL = 4002
  205. EVENT_COPY_JOB_CANCELED = 4003
  206. #end
  207.  
  208. # Adding the ERROR_CODE_BASE to the above
  209. # ERROR codes will produce a event/status code
  210. # e.g., EVENT_ERROR_DEVICE_NOT_FOUND=2 -> 5002 status/event code
  211. ERROR_CODE_BASE = 5000
  212. EVENT_ERROR_SUCCESS = 5000
  213. EVENT_ERROR_UNKNOWN_ERROR = 5001
  214. EVENT_ERROR_DEVICE_NOT_FOUND = 5002
  215. EVENT_ERROR_INVALID_DEVICE_ID = 5003
  216. EVENT_ERROR_INVALID_DEVICE_URI = 5004
  217. EVENT_ERROR_DATA_LENGTH_EXCEEDS_MAX = 5008
  218. EVENT_ERROR_DEVICE_IO_ERROR = 5012
  219. EVENT_ERROR_NO_PROBED_DEVICES_FOUND = 5018
  220. EVENT_ERROR_DEVICE_BUSY = 5021
  221. EVENT_ERROR_DEVICE_STATUS_NOT_AVAILABLE = 5026
  222. EVENT_ERROR_INVALID_SERVICE_NAME = 5028
  223. EVENT_ERROR_ERROR_INVALID_CHANNEL_ID = 5030
  224. EVENT_ERROR_CHANNEL_BUSY = 5031
  225. EVENT_ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION = 5034
  226. EVENT_ERROR_DEVICEOPEN_FAILED_ONE_DEVICE_ONLY = 5037
  227. EVENT_ERROR_DEVICEOPEN_FAILED_DEV_NODE_MOVED = 5038
  228. # end
  229.  
  230. # pcard
  231. EVENT_START_PCARD_JOB = 6000
  232. EVENT_END_PCARD_JOB = 6001
  233. EVENT_PCARD_JOB_FAIL = 6002
  234. EVENT_PCARD_UNABLE_TO_MOUNT = 6003
  235. EVENT_PCARD_FILES_TRANSFERED = 6004
  236. # end
  237.  
  238. EVENT_MAX_USER_EVENT = 7999
  239. # end of user events
  240. # start of internal events
  241.  
  242. # fax (internal events)
  243. EVENT_FAX_MIN = 8000
  244. EVENT_FAX_RENDER_COMPLETE = 8000 
  245. EVENT_FAX_WAITING = 8001 # Sent by hpssd to toolbox when fax is waiting
  246. EVENT_FAX_ADDRESS_BOOK_UPDATED = 8002 # Sent by FAB to indicate that the dB has changed
  247. EVENT_FAX_MAX = 8999
  248. # end
  249.  
  250. # UI
  251. EVENT_MIN_UI_EVENT = 9000
  252. EVENT_CUPS_QUEUES_CHANGED = 9000 # sent by hp-setup if queues added (or removed)
  253. EVENT_RAISE_DEVICE_MANAGER = 9001
  254. #EVENT_JOB_STORAGE_UI_REQUEST = 9002 # sent by hplipjs CUPS filter for job storage UI
  255. EVENT_HISTORY_UPDATE = 9003 # sent by hp-systray to hp-toolbox when a device's history changes
  256. EVENT_MAX_UI_EVENT = 9999
  257.  
  258. EVENT_MAX_EVENT = 9999
  259.  
  260. # do not add any events > 100000 (PJL error code space) 
  261.  
  262. # end of events
  263.  
  264.  
  265. # Error states
  266. ERROR_STATE_CLEAR = 0        # Show icon w/o overlay
  267. ERROR_STATE_OK = 1           # Icon w/ "OK" overlay
  268. ERROR_STATE_MAX_OK = 99
  269. ERROR_STATE_WARNING = 100      # Icon w/ triangle "!" overlay
  270. ERROR_STATE_ERROR = 101        # Icon w/ circle "X" overlay
  271. ERROR_STATE_LOW_SUPPLIES = 102 # Icon w/ supplies overlay
  272. ERROR_STATE_BUSY = 103         # Icon with busy overlay
  273. ERROR_STATE_LOW_PAPER = 104    # Icon w/ paper low overlay
  274. ERROR_STATE_PRINTING = 105
  275. ERROR_STATE_SCANNING = 106
  276. ERROR_STATE_PHOTOCARD = 107
  277. ERROR_STATE_FAXING = 108
  278. ERROR_STATE_COPYING = 109
  279. ERROR_STATE_REFRESHING = 999 
  280. #end
  281.  
  282.  
  283. # Map of status/event codes to UI states
  284. STATUS_TO_ERROR_STATE_MAP = {
  285.     STATUS_UNKNOWN : ERROR_STATE_CLEAR,
  286.     EVENT_START_PRINT_JOB : ERROR_STATE_BUSY,
  287.     EVENT_END_PRINT_JOB   : ERROR_STATE_OK,
  288.     EVENT_START_FAX_PRINT_JOB : ERROR_STATE_BUSY,
  289.     EVENT_END_FAX_PRINT_JOB : ERROR_STATE_FAXING,
  290.     
  291.     EVENT_PRINTER_QUEUE_STOPPED : ERROR_STATE_WARNING,
  292.     EVENT_PRINTER_QUEUE_STARTED : ERROR_STATE_CLEAR,
  293.     EVENT_PRINTER_QUEUE_REJECTING_JOBS : ERROR_STATE_WARNING,
  294.     EVENT_PRINTER_QUEUE_ACCEPTING_JOBS : ERROR_STATE_CLEAR,
  295.     EVENT_PRINTER_QUEUE_SET_AS_DEFAULT : ERROR_STATE_OK,
  296.     
  297.     EVENT_FAX_QUEUE_STOPPED : ERROR_STATE_WARNING,
  298.     EVENT_FAX_QUEUE_STARTED : ERROR_STATE_CLEAR,
  299.     EVENT_FAX_QUEUE_REJECTING_JOBS : ERROR_STATE_WARNING,
  300.     EVENT_FAX_QUEUE_ACCEPTING_JOBS : ERROR_STATE_CLEAR,
  301.     EVENT_FAX_QUEUE_SET_AS_DEFAULT : ERROR_STATE_OK,
  302.     
  303.     STATUS_PRINTER_IDLE : ERROR_STATE_CLEAR,
  304.     STATUS_PRINTER_BUSY : ERROR_STATE_BUSY,
  305.     STATUS_PRINTER_PRINTING : ERROR_STATE_PRINTING,
  306.     STATUS_PRINTER_TURNING_OFF : ERROR_STATE_BUSY,
  307.     STATUS_PRINTER_REPORT_PRINTING : ERROR_STATE_PRINTING,
  308.     STATUS_PRINTER_CANCELING : ERROR_STATE_BUSY,
  309.     STATUS_PRINTER_IO_STALL : ERROR_STATE_ERROR,
  310.     STATUS_PRINTER_DRY_WAIT_TIME : ERROR_STATE_PRINTING,
  311.     STATUS_PRINTER_PEN_CHANGE : ERROR_STATE_WARNING,
  312.     STATUS_PRINTER_OUT_OF_PAPER : ERROR_STATE_WARNING,
  313.     STATUS_PRINTER_BANNER_EJECT : ERROR_STATE_WARNING,
  314.     STATUS_PRINTER_BANNER_MISMATCH : ERROR_STATE_WARNING,
  315.     STATUS_PRINTER_PHOTO_MISMATCH : ERROR_STATE_WARNING,
  316.     STATUS_PRINTER_DUPLEX_MISMATCH : ERROR_STATE_WARNING,
  317.     STATUS_PRINTER_MEDIA_JAM : ERROR_STATE_ERROR,
  318.     STATUS_PRINTER_CARRIAGE_STALL : ERROR_STATE_ERROR,
  319.     STATUS_PRINTER_PAPER_STALL : ERROR_STATE_ERROR,
  320.     STATUS_PRINTER_PEN_FAILURE : ERROR_STATE_ERROR,
  321.     STATUS_PRINTER_HARD_ERROR : ERROR_STATE_ERROR,
  322.     STATUS_PRINTER_POWER_DOWN : ERROR_STATE_ERROR,
  323.     STATUS_PRINTER_FRONT_PANEL_TEST : ERROR_STATE_ERROR,
  324.     STATUS_PRINTER_CLEAN_OUT_TRAY_MISSING : ERROR_STATE_ERROR,
  325.     STATUS_PRINTER_OUTPUT_BIN_FULL : ERROR_STATE_ERROR,
  326.     STATUS_PRINTER_MEDIA_SIZE_MISMATCH : ERROR_STATE_WARNING,
  327.     STATUS_PRINTER_MANUAL_DUPLEX_BLOCK : ERROR_STATE_ERROR,
  328.     STATUS_PRINTER_SERVCE_STALL : ERROR_STATE_ERROR,
  329.     STATUS_PRINTER_OUT_OF_INK : ERROR_STATE_ERROR,
  330.     STATUS_PRINTER_LIO_ERROR : ERROR_STATE_ERROR,
  331.     STATUS_PRINTER_PUMP_STALL : ERROR_STATE_ERROR,
  332.     STATUS_PRINTER_TRAY_2_MISSING : ERROR_STATE_ERROR,
  333.     STATUS_PRINTER_DUPLEXER_MISSING : ERROR_STATE_ERROR,
  334.     STATUS_PRINTER_REAR_TRAY_MISSING : ERROR_STATE_ERROR,
  335.     STATUS_PRINTER_PEN_NOT_LATCHED : ERROR_STATE_ERROR,
  336.     STATUS_PRINTER_BATTERY_VERY_LOW : ERROR_STATE_WARNING,
  337.     STATUS_PRINTER_SPITTOON_FULL : ERROR_STATE_ERROR,
  338.     STATUS_PRINTER_OUTPUT_TRAY_CLOSED : ERROR_STATE_ERROR,
  339.     STATUS_PRINTER_MANUAL_FEED_BLOCKED : ERROR_STATE_ERROR,
  340.     STATUS_PRINTER_REAR_FEED_BLOCKED : ERROR_STATE_ERROR,
  341.     STATUS_PRINTER_TRAY_2_OUT_OF_PAPER : ERROR_STATE_LOW_PAPER,
  342.     STATUS_PRINTER_UNABLE_TO_LOAD_FROM_LOCKED_TRAY : ERROR_STATE_ERROR,
  343.     STATUS_PRINTER_NON_HP_INK : ERROR_STATE_WARNING,
  344.     STATUS_PRINTER_PEN_CALIBRATION_RESUME : ERROR_STATE_WARNING,
  345.     STATUS_PRINTER_MEDIA_TYPE_MISMATCH : ERROR_STATE_WARNING,
  346.     STATUS_PRINTER_CUSTOM_MEDIA_MISMATCH : ERROR_STATE_WARNING,
  347.     STATUS_PRINTER_PEN_CLEANING : ERROR_STATE_WARNING,
  348.     STATUS_PRINTER_PEN_CLEANING : ERROR_STATE_WARNING,
  349.     STATUS_PRINTER_WARMING_UP : ERROR_STATE_BUSY,
  350.     STATUS_PRINTER_LOW_PAPER : ERROR_STATE_LOW_PAPER,
  351.     STATUS_PRINTER_DOOR_OPEN : ERROR_STATE_ERROR,
  352.     STATUS_PRINTER_OFFLINE : ERROR_STATE_ERROR,
  353.     STATUS_PRINTER_LOW_TONER : ERROR_STATE_LOW_SUPPLIES,
  354.     STATUS_PRINTER_NO_TONER : ERROR_STATE_LOW_SUPPLIES,
  355.     STATUS_PRINTER_SERVICE_REQUEST : ERROR_STATE_ERROR,
  356.     STATUS_PRINTER_FUSER_ERROR : ERROR_STATE_ERROR,
  357.     STATUS_DEVICE_UNSUPPORTED : ERROR_STATE_ERROR,
  358.     # The following block are EVENTs because they are only
  359.     # recieved as events from hpmud, hp backend, etc.
  360.     # i.e., a device does not produce status codes in this range
  361.     EVENT_ERROR_SUCCESS : ERROR_STATE_CLEAR,
  362.     EVENT_ERROR_UNKNOWN_ERROR : ERROR_STATE_ERROR,
  363.     EVENT_ERROR_DEVICE_NOT_FOUND : ERROR_STATE_ERROR,
  364.     EVENT_ERROR_INVALID_DEVICE_ID : ERROR_STATE_ERROR,
  365.     EVENT_ERROR_INVALID_DEVICE_URI : ERROR_STATE_ERROR,
  366.     EVENT_ERROR_DATA_LENGTH_EXCEEDS_MAX : ERROR_STATE_WARNING,
  367.     EVENT_ERROR_DEVICE_IO_ERROR : ERROR_STATE_ERROR,
  368.     EVENT_ERROR_NO_PROBED_DEVICES_FOUND : ERROR_STATE_WARNING,
  369.     EVENT_ERROR_DEVICE_BUSY : ERROR_STATE_BUSY,
  370.     EVENT_ERROR_DEVICE_STATUS_NOT_AVAILABLE : ERROR_STATE_ERROR,
  371.     EVENT_ERROR_INVALID_SERVICE_NAME : ERROR_STATE_ERROR,
  372.     EVENT_ERROR_ERROR_INVALID_CHANNEL_ID : ERROR_STATE_ERROR,
  373.     EVENT_ERROR_CHANNEL_BUSY : ERROR_STATE_BUSY,
  374.     EVENT_ERROR_DEVICE_DOES_NOT_SUPPORT_OPERATION : ERROR_STATE_ERROR,
  375.     EVENT_ERROR_DEVICEOPEN_FAILED_ONE_DEVICE_ONLY : ERROR_STATE_ERROR,
  376.     EVENT_ERROR_DEVICEOPEN_FAILED_DEV_NODE_MOVED : ERROR_STATE_ERROR,
  377.     # Scan
  378.     EVENT_START_SCAN_JOB : ERROR_STATE_SCANNING,
  379.     EVENT_END_SCAN_JOB : ERROR_STATE_OK,
  380.     EVENT_SCANNER_FAIL : ERROR_STATE_ERROR,
  381.     # Fax
  382.     EVENT_START_FAX_JOB : ERROR_STATE_FAXING,
  383.     EVENT_END_FAX_JOB : ERROR_STATE_OK,
  384.     EVENT_FAX_JOB_FAIL : ERROR_STATE_ERROR,
  385.     EVENT_FAX_JOB_CANCELED : ERROR_STATE_ERROR,
  386.     STATUS_FAX_TX_ACTIVE : ERROR_STATE_FAXING,
  387.     STATUS_FAX_RX_ACTIVE : ERROR_STATE_FAXING,
  388.     # Copy
  389.     EVENT_START_COPY_JOB : ERROR_STATE_COPYING,
  390.     EVENT_END_COPY_JOB : ERROR_STATE_OK,
  391.     EVENT_COPY_JOB_FAIL : ERROR_STATE_ERROR,
  392.     EVENT_COPY_JOB_CANCELED : ERROR_STATE_ERROR,
  393.     # PCard
  394.     EVENT_START_PCARD_JOB : ERROR_STATE_PHOTOCARD,
  395.     EVENT_END_PCARD_JOB : ERROR_STATE_CLEAR,
  396.     EVENT_PCARD_JOB_FAIL : ERROR_STATE_ERROR,
  397.     EVENT_PCARD_UNABLE_TO_MOUNT : ERROR_STATE_ERROR,
  398.     EVENT_PCARD_FILES_TRANSFERED : ERROR_STATE_OK,
  399.  
  400.     # Low supplies
  401.     STATUS_PRINTER_LOW_BLACK_INK : ERROR_STATE_LOW_SUPPLIES,
  402.     STATUS_PRINTER_LOW_TRI_COLOR_INK : ERROR_STATE_LOW_SUPPLIES,
  403.     STATUS_PRINTER_LOW_PHOTO_INK : ERROR_STATE_LOW_SUPPLIES,
  404.     STATUS_PRINTER_LOW_CYAN_INK : ERROR_STATE_LOW_SUPPLIES,
  405.     STATUS_PRINTER_LOW_MAGENTA_INK : ERROR_STATE_LOW_SUPPLIES,
  406.     STATUS_PRINTER_LOW_YELLOW_INK : ERROR_STATE_LOW_SUPPLIES,
  407.     STATUS_PRINTER_LOW_PHOTO_CYAN_INK : ERROR_STATE_LOW_SUPPLIES,
  408.     STATUS_PRINTER_LOW_PHOTO_MAGENTA_INK : ERROR_STATE_LOW_SUPPLIES,
  409.     STATUS_PRINTER_LOW_PHOTO_YELLOW_INK : ERROR_STATE_LOW_SUPPLIES,
  410.     STATUS_PRINTER_LOW_PHOTO_GRAY_INK : ERROR_STATE_LOW_SUPPLIES,
  411.     STATUS_PRINTER_LOW_PHOTO_BLUE_INK : ERROR_STATE_LOW_SUPPLIES,
  412.  
  413.     STATUS_PRINTER_LOW_BLACK_TONER : ERROR_STATE_LOW_SUPPLIES,
  414.     STATUS_PRINTER_LOW_CYAN_TONER : ERROR_STATE_LOW_SUPPLIES,
  415.     STATUS_PRINTER_LOW_MAGENTA_TONER : ERROR_STATE_LOW_SUPPLIES,
  416.     STATUS_PRINTER_LOW_YELLOW_TONER : ERROR_STATE_LOW_SUPPLIES,
  417.     # end
  418.  
  419. }
  420.  
  421.  
  422. # Device states
  423. DEVICE_STATE_NOT_FOUND = -1
  424. DEVICE_STATE_FOUND = 0
  425. DEVICE_STATE_JUST_FOUND = 1
  426.  
  427.  
  428. # I/O states
  429. IO_STATE_HP_OPEN = 0
  430. IO_STATE_HP_READY = 1
  431. IO_STATE_HP_NOT_AVAIL = 2
  432. IO_STATE_NON_HP = 3
  433.  
  434. #
  435. # Defines for model query types and status query
  436. #
  437.  
  438. # agent info
  439.  
  440. # 'kind'
  441. AGENT_KIND_NONE = 0
  442. AGENT_KIND_HEAD = 1 # InkJet head (no ink)
  443. AGENT_KIND_SUPPLY = 2 # InkJet supply (ink tank)
  444. AGENT_KIND_HEAD_AND_SUPPLY = 3 # InkJet (cartridge)
  445. AGENT_KIND_TONER_CARTRIDGE = 4 # LaserJet
  446. AGENT_KIND_MAINT_KIT = 5 # LaserJet "Maintenance kit (fuser)"
  447. AGENT_KIND_ADF_KIT = 6 # LaserJet "Document feeder kit"
  448. AGENT_KIND_DRUM_KIT = 7 # LaserJet
  449. AGENT_KIND_TRANSFER_KIT = 8 # LaserJet
  450. AGENT_KIND_INT_BATTERY = 9 # Mobile deskjet (DJ450, etc)
  451. AGENT_KIND_UNKNOWN = 0x3e # (62)
  452.  
  453. # 'type'
  454. AGENT_TYPE_NONE = 0
  455. AGENT_TYPE_BLACK = 1
  456. AGENT_TYPE_CMY = 2 # Tricolor
  457. AGENT_TYPE_KCM = 3 # Photo
  458. AGENT_TYPE_CYAN = 4
  459. AGENT_TYPE_MAGENTA = 5
  460. AGENT_TYPE_YELLOW = 6
  461. AGENT_TYPE_CYAN_LOW = 7
  462. AGENT_TYPE_MAGENTA_LOW = 8
  463. AGENT_TYPE_YELLOW_LOW = 9
  464. AGENT_TYPE_GGK = 10 # 2 shades of grey and black
  465. AGENT_TYPE_BLUE = 11
  466. AGENT_TYPE_KCMY_CM = 12 # K/C/M/Y/LM/LC (02 pen set head)
  467. AGENT_TYPE_LC_LM = 13 # light cyan and light magenta
  468. #AGENT_TYPE_Y_M = 14 # yellow and magenta (B9180)
  469. #AGENT_TYPE_C_K = 15 # cyan and black (B9180)
  470. AGENT_TYPE_K_Y = 14 # black and yellow (for LJ Pro)
  471. AGENT_TYPE_C_M = 15 # cyan and magenta (for LJ Pro)
  472. AGENT_TYPE_LG_PK = 16 # light grey and photo black
  473. AGENT_TYPE_LG = 17 # light grey
  474. AGENT_TYPE_G = 18 # medium grey
  475. AGENT_TYPE_PG = 19 # photo grey
  476. AGENT_TYPE_WHITE = 0x20 # For ISO 10180 compatibility
  477. AGENT_TYPE_RED = 0x21 # For ISO 10180 compatibility
  478. AGENT_TYPE_UNSPECIFIED = 0x3e # (62) Used for kind = 5, 6, 7, 8, or 9
  479. AGENT_TYPE_ERROR = 0x3f # (63)
  480.  
  481. # 'health'
  482. AGENT_HEALTH_OK = 0
  483. AGENT_HEALTH_MISINSTALLED = 1 # supply/cart
  484. AGENT_HEALTH_FAIR_MODERATE = 1 # head
  485. AGENT_HEALTH_INCORRECT = 2
  486. AGENT_HEALTH_FAILED = 3
  487. AGENT_HEALTH_OVERTEMP = 4 # Battery
  488. AGENT_HEALTH_CHARGING = 5 # Battery
  489. AGENT_HEALTH_DISCHARGING = 6 # Battery
  490. AGENT_HEALTH_UNKNOWN = 0xff
  491.  
  492. # 'level'
  493. AGENT_LEVEL_TRIGGER_SUFFICIENT_0 = 0
  494. AGENT_LEVEL_TRIGGER_SUFFICIENT_1 = 1
  495. AGENT_LEVEL_TRIGGER_SUFFICIENT_2 = 2
  496. AGENT_LEVEL_TRIGGER_SUFFICIENT_3 = 3
  497. AGENT_LEVEL_TRIGGER_SUFFICIENT_4 = 4
  498. AGENT_LEVEL_TRIGGER_MAY_BE_LOW = 5
  499. AGENT_LEVEL_TRIGGER_PROBABLY_OUT = 6
  500. AGENT_LEVEL_TRIGGER_ALMOST_DEFINITELY_OUT = 7
  501.  
  502. # "Computed" configurations (2-pen products)
  503. AGENT_CONFIG_NONE = 0
  504. AGENT_CONFIG_BLACK_ONLY = 1
  505. AGENT_CONFIG_PHOTO_ONLY = 2
  506. AGENT_CONFIG_COLOR_ONLY = 3
  507. AGENT_CONFIG_GREY_ONLY = 4
  508. AGENT_CONFIG_COLOR_AND_BLACK = 5
  509. AGENT_CONFIG_COLOR_AND_PHOTO = 6
  510. AGENT_CONFIG_COLOR_AND_GREY = 7
  511. AGENT_CONFIG_INVALID = 99
  512.  
  513. # align-types
  514. ALIGN_TYPE_NONE = 0
  515. ALIGN_TYPE_AUTO = 1
  516. ALIGN_TYPE_8XX = 2
  517. ALIGN_TYPE_9XX = 3
  518. ALIGN_TYPE_LIDIL_0_3_8 = 4
  519. ALIGN_TYPE_LIDIL_0_4_3 = 5
  520. ALIGN_TYPE_LIDIL_AIO = 6
  521. ALIGN_TYPE_LIDIL_VIP = 7
  522. ALIGN_TYPE_DESKJET_450 = 8
  523. ALIGN_TYPE_9XX_NO_EDGE_ALIGN = 9
  524. ALIGN_TYPE_LBOW = 10
  525. ALIGN_TYPE_LIDIL_0_5_4 = 11
  526. ALIGN_TYPE_OJ_PRO = 12 # OJ Pro L7xxx
  527.  
  528. # clean-types
  529. CLEAN_TYPE_NONE = 0
  530. CLEAN_TYPE_PCL = 1
  531. CLEAN_TYPE_LIDIL = 2
  532. CLEAN_TYPE_PCL_WITH_PRINTOUT = 3
  533.  
  534. # color-cal-types
  535. COLOR_CAL_TYPE_NONE = 0
  536. COLOR_CAL_TYPE_DESKJET_450 = 1
  537. COLOR_CAL_TYPE_MALIBU_CRICK = 2
  538. COLOR_CAL_TYPE_STRINGRAY_LONGBOW_TORNADO = 3
  539. COLOR_CAL_TYPE_CONNERY = 4
  540. COLOR_CAL_TYPE_COUSTEAU = 5
  541. COLOR_CAL_TYPE_CARRIER = 6
  542. COLOR_CAL_TYPE_TYPHOON = 7
  543.  
  544. # status-types
  545. STATUS_TYPE_NONE = 0
  546. STATUS_TYPE_VSTATUS = 1
  547. STATUS_TYPE_S = 2
  548. STATUS_TYPE_LJ = 3
  549. #STATUS_TYPE_S_W_BATTERY = 4 # DEPRECATED
  550. #STATUS_TYPE_S_SNMP = 5 # DEPRECATED
  551. STATUS_TYPE_LJ_XML = 6
  552. #STATUS_TYPE_S_LIDIL = 7 # DEPRECATED
  553. STATUS_TYPE_PJL = 8
  554. STATUS_TYPE_PML_AND_PJL = 9 # Same as types 3(tbx)+8(hp:)
  555.  
  556. # status-battery-check
  557. STATUS_BATTERY_CHECK_NONE = 0
  558. STATUS_BATTERY_CHECK_STD = 1 # Deskjet 450/460 (PML or dyn. counters)
  559. STATUS_BATTERY_CHECK_PML = 2 # Officejet H470 (PML)
  560.  
  561. # status-dynamic-counters
  562. STATUS_DYNAMIC_COUNTERS_NONE = 0
  563. STATUS_DYNAMIC_COUNTERS_PCL = 1
  564. STATUS_DYNAMIC_COUNTERS_PML_SNMP = 2
  565. STATUS_DYNAMIC_COUNTERS_LIDIL_0_5_4 = 3 # Deskjet D4100
  566.  
  567. # tech-types
  568. TECH_TYPE_NONE = 0
  569. TECH_TYPE_MONO_INK = 1
  570. TECH_TYPE_COLOR_INK = 2
  571. TECH_TYPE_MONO_LASER = 3
  572. TECH_TYPE_COLOR_LASER = 4
  573. TECH_TYPE_COLOR_EDGELINE = 5
  574.  
  575. # support-type
  576. SUPPORT_TYPE_NONE = 0
  577. SUPPORT_TYPE_HPIJS = 1
  578. SUPPORT_TYPE_HPLIP = 2
  579.  
  580. # fax-types
  581. FAX_TYPE_NOT_SUPPORTED = -1
  582. FAX_TYPE_NONE = 0
  583. FAX_TYPE_BLACK_SEND_EARLY_OPEN = 1 # newer models
  584. FAX_TYPE_BLACK_SEND_LATE_OPEN = 2 # older models
  585. FAX_TYPE_BLACK_AND_COLOR_SEND = 3 # future
  586. FAX_TYPE_SOAP = 4
  587.  
  588. # pcard-types
  589. PCARD_TYPE_NONE = 0
  590. PCARD_TYPE_MLC = 1
  591. PCARD_TYPE_USB_MASS_STORAGE = 2
  592.  
  593. # scan-types
  594. SCAN_TYPE_NOT_SUPPORTED = -1
  595. SCAN_TYPE_NONE = 0
  596. SCAN_TYPE_SCL = 1
  597. SCAN_TYPE_PML = 2
  598. SCAN_TYPE_SOAP = 3
  599. SCAN_TYPE_MARVEL = 4
  600. SCAN_TYPE_SOAP2 = 5
  601.  
  602. # scan-styles
  603. SCAN_STYLE_NONE = 0
  604. SCAN_STYLE_FLATBED = 1
  605. SCAN_STYLE_SCROLLFED = 2
  606.  
  607. # copy-types
  608. COPY_TYPE_NOT_SUPPORTED = -1
  609. COPY_TYPE_NONE = 0
  610. COPY_TYPE_DEVICE = 1 # LaserJet MFP PML
  611. COPY_TYPE_SCAN_TO_PRINT = 2
  612. COPY_TYPE_AIO_DEVICE = 3 # Inkjet AiO PML
  613.  
  614. # 'top_door' (lid)
  615. TOP_DOOR_NOT_PRESENT = 0
  616. TOP_DOOR_CLOSED = 1
  617. TOP_DOOR_OPEN = 2
  618.  
  619. # 'supply_door'
  620. SUPPLY_DOOR_NOT_PRESENT = 0
  621. SUPPLY_DOOR_CLOSED = 1
  622. SUPPLY_DOOR_OPEN = 2
  623.  
  624. # 'media_path'
  625. MEDIA_PATH_NOT_PRESENT = 0 # S:00 means banner not present
  626. MEDIA_PATH_CUT_SHEET = 1 # S:01 means banner present/engaged
  627. MEDIA_PATH_BANNER = 2
  628. MEDIA_PATH_PHOTO = 3
  629.  
  630. # 'photo_tray'(S:03 photo/hagaki)
  631. PHOTO_TRAY_NOT_PRESENT = 0
  632. PHOTO_TRAY_NOT_ENGAGED = 1
  633. PHOTO_TRAY_ENGAGED = 2
  634.  
  635. # 'duplexer' (S:02 cleanout)
  636. DUPLEXER_NOT_PRESENT = 0
  637. DUPLEXER_DOOR_CLOSED = 1
  638. DUPLEXER_DOOR_OPEN = 2
  639.  
  640. # 'in_tray1' & 'in_tray2'
  641. IN_TRAY_NOT_PRESENT = 0
  642. IN_TRAY_PRESENT = 1 # for !S:02, test for > IN_TRAY_NOT_PRESENT
  643. IN_TRAY_DEFAULT = 2 # S:02 only
  644. IN_TRAY_LOCKED = 3 # S:02 only
  645.  
  646. # 'io-support'
  647. IO_SUPPORT_PARALLEL = 0x1
  648. IO_SUPPORT_USB = 0x2
  649. IO_SUPPORT_NETWORK = 0x4
  650. IO_SUPPORT_WIRELESS = 0x8
  651. IO_SUPPORT_BLUETOOTH = 0x10
  652.  
  653. # User friendly model categories
  654. MODEL_TYPE2_UNSUPPORTED = 0
  655. MODEL_TYPE2_DESKJET = 1
  656. MODEL_TYPE2_DESKJET_AIO = 2
  657. MODEL_TYPE2_PHOTOSMART = 3
  658. MODEL_TYPE2_OFFICEJET = 4
  659. MODEL_TYPE2_PSC = 5
  660. MODEL_TYPE2_LASERJET = 6
  661. MODEL_TYPE2_COLOR_LASERJET = 7
  662. MODEL_TYPE2_BIJ = 8
  663. MODEL_TYPE2_EDGELINE = 9
  664. MODEL_TYPE2_APOLLO = 10
  665. MODEL_TYPE2_SCANJET = 11 # not supported
  666. MODEL_TYPE2_DESIGNJET = 12 # not supported
  667. MODEL_TYPE2_OTHER = 13 # No specific "sub-brand" (e.g., 910, cp1610)
  668.  
  669. # 'io-mode' and 'io-mfp-mode'
  670. IO_MODE_UNI = 0
  671. IO_MODE_RAW = 1
  672. #IO_MODE_NOT_USED = 2
  673. IO_MODE_DOT4 = 3
  674. IO_MODE_DOT4_PHOENIX = 4
  675. IO_MODE_DOT4_BRIDGE = 5
  676. IO_MODE_MLC_GUSHER = 6
  677. IO_MODE_MLC_MISER = 7
  678.  
  679. # plugins
  680. PLUGIN_NONE = 0
  681. PLUGIN_REQUIRED = 1
  682. PLUGIN_OPTIONAL = 2
  683.  
  684. # embedded web server
  685. EWS_NONE = 0
  686. EWS_PRESENT = 1
  687.  
  688. # panel check
  689. PANEL_CHECK_TYPE_NONE = 0
  690. PANEL_CHECK_TYPE_CHECK = 1
  691.  
  692. # pq diag
  693. PQ_DIAG_TYPE_NONE = 0
  694. PQ_DIAG_TYPE_1 = 1
  695. PQ_DIAG_TYPE_2 = 2
  696.  
  697. # line feed cal
  698. LINEFEED_CAL_TYPE_NONE = 0
  699. LINEFEED_CAL_TYPE_OJ_K550 = 1
  700. LINEFEED_CAL_TYPE_OJ_PRO_L7XXX = 2
  701.  
  702. # power-settings
  703. POWER_SETTINGS_NONE = 0
  704. POWER_SETTINGS_EPML = 1 # DJ450/DJ460
  705. POWER_SETTINGS_PML = 2 # OJ H470
  706.  
  707. # Paper types (for hp-toolbox paper prompts)
  708. PAPER_TYPE_PLAIN = 0
  709. PAPER_TYPE_HP_ADV_PHOTO = 1
  710.  
  711. # job-storage
  712. JOB_STORAGE_DISABLE = 0
  713. JOB_STORAGE_ENABLE = 1
  714.  
  715. JOB_STORAGE_TYPE_OFF = 0
  716. JOB_STORAGE_TYPE_PROOF_AND_HOLD = 1
  717. JOB_STORAGE_TYPE_PERSONAL = 2
  718. JOB_STORAGE_TYPE_QUICK_COPY = 3
  719. JOB_STORAGE_TYPE_STORE = 4
  720.  
  721.  
  722.